// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_SO
// * CreateDate    : 2014-06-05 18:30:39
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:39
// * LastChanger   : 2014-06-05 18:30:39
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesSoEntity : EntityBase
    {
        public SalesSoTable TableSchema
        {
            get
            {
                return SalesSoTable.Current;
            }
		}
		
		public SalesSoEntity()
        {

        }
		
		public SalesSoEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.SoNo = Convert.ToString(CommonFunctions.ToObject(dr["SO_NO"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.Tel = Convert.ToString(CommonFunctions.ToObject(dr["TEL"]));
			this.CustomerId = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_ID"]));
			this.CustomerName = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_NAME"]));
			this.CustomerCode = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_CODE"]));
			this.OrderPerson = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_PERSON"]));
			this.OrderDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ORDER_DATE"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.TransportType = Convert.ToString(CommonFunctions.ToObject(dr["TRANSPORT_TYPE"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.IsConfirm = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_CONFIRM"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }
		
		public SalesSoEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CompanyId = Convert.ToString(CommonFunctions.ToObject(dr["COMPANY_ID"]));
			this.SobId = Convert.ToString(CommonFunctions.ToObject(dr["SOB_ID"]));
			this.SoNo = Convert.ToString(CommonFunctions.ToObject(dr["SO_NO"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.Tel = Convert.ToString(CommonFunctions.ToObject(dr["TEL"]));
			this.CustomerId = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_ID"]));
			this.CustomerName = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_NAME"]));
			this.CustomerCode = Convert.ToString(CommonFunctions.ToObject(dr["CUSTOMER_CODE"]));
			this.OrderPerson = Convert.ToString(CommonFunctions.ToObject(dr["ORDER_PERSON"]));
			this.OrderDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ORDER_DATE"]));
			this.TotalAmount = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_AMOUNT"]));
			this.Currency = Convert.ToString(CommonFunctions.ToObject(dr["CURRENCY"]));
			this.DeliveryAdd = Convert.ToString(CommonFunctions.ToObject(dr["DELIVERY_ADD"]));
			this.TransportType = Convert.ToString(CommonFunctions.ToObject(dr["TRANSPORT_TYPE"]));
			this.PackageType = Convert.ToString(CommonFunctions.ToObject(dr["PACKAGE_TYPE"]));
			this.PaymentType = Convert.ToString(CommonFunctions.ToObject(dr["PAYMENT_TYPE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.IsConfirm = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_CONFIRM"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesSoTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_ID)); }
            set { SetData(SalesSoTable.C_ID, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(SalesSoTable.C_CREATED_DATE)); }
            set { SetData(SalesSoTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CREATED_BY)); }
            set { SetData(SalesSoTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(SalesSoTable.C_UPDATED_DATE)); }
            set { SetData(SalesSoTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_UPDATED_BY)); }
            set { SetData(SalesSoTable.C_UPDATED_BY, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(SalesSoTable.C_IS_ACTIVE)); }
            set { SetData(SalesSoTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public string CompanyId
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_COMPANY_ID)); }
            set { SetData(SalesSoTable.C_COMPANY_ID, value); }
        }
		
        [DataMember]
        public string SobId
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_SOB_ID)); }
            set { SetData(SalesSoTable.C_SOB_ID, value); }
        }
		
        [DataMember]
        public string SoNo
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_SO_NO)); }
            set { SetData(SalesSoTable.C_SO_NO, value); }
        }
		
        [DataMember]
        public string QuNo
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_QU_NO)); }
            set { SetData(SalesSoTable.C_QU_NO, value); }
        }
		
        [DataMember]
        public string ContactId
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CONTACT_ID)); }
            set { SetData(SalesSoTable.C_CONTACT_ID, value); }
        }
		
        [DataMember]
        public string ContactUser
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CONTACT_USER)); }
            set { SetData(SalesSoTable.C_CONTACT_USER, value); }
        }
		
        [DataMember]
        public string Tel
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_TEL)); }
            set { SetData(SalesSoTable.C_TEL, value); }
        }
		
        [DataMember]
        public string CustomerId
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CUSTOMER_ID)); }
            set { SetData(SalesSoTable.C_CUSTOMER_ID, value); }
        }
		
        [DataMember]
        public string CustomerName
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CUSTOMER_NAME)); }
            set { SetData(SalesSoTable.C_CUSTOMER_NAME, value); }
        }
		
        [DataMember]
        public string CustomerCode
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CUSTOMER_CODE)); }
            set { SetData(SalesSoTable.C_CUSTOMER_CODE, value); }
        }
		
        [DataMember]
        public string OrderPerson
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_ORDER_PERSON)); }
            set { SetData(SalesSoTable.C_ORDER_PERSON, value); }
        }
		
        [DataMember]
        public DateTime OrderDate
        {
            get { return Convert.ToDateTime(GetData(SalesSoTable.C_ORDER_DATE)); }
            set { SetData(SalesSoTable.C_ORDER_DATE, value); }
        }
		
        [DataMember]
        public decimal TotalAmount
        {
            get { return Convert.ToDecimal(GetData(SalesSoTable.C_TOTAL_AMOUNT)); }
            set { SetData(SalesSoTable.C_TOTAL_AMOUNT, value); }
        }
		
        [DataMember]
        public string Currency
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_CURRENCY)); }
            set { SetData(SalesSoTable.C_CURRENCY, value); }
        }
		
        [DataMember]
        public string DeliveryAdd
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_DELIVERY_ADD)); }
            set { SetData(SalesSoTable.C_DELIVERY_ADD, value); }
        }
		
        [DataMember]
        public string TransportType
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_TRANSPORT_TYPE)); }
            set { SetData(SalesSoTable.C_TRANSPORT_TYPE, value); }
        }
		
        [DataMember]
        public string PackageType
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_PACKAGE_TYPE)); }
            set { SetData(SalesSoTable.C_PACKAGE_TYPE, value); }
        }
		
        [DataMember]
        public string PaymentType
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_PAYMENT_TYPE)); }
            set { SetData(SalesSoTable.C_PAYMENT_TYPE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_REMARK)); }
            set { SetData(SalesSoTable.C_REMARK, value); }
        }
		
        [DataMember]
        public int IsConfirm
        {
            get { return Convert.ToInt32(GetData(SalesSoTable.C_IS_CONFIRM)); }
            set { SetData(SalesSoTable.C_IS_CONFIRM, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(SalesSoTable.C_STATUS)); }
            set { SetData(SalesSoTable.C_STATUS, value); }
        }
		
		#endregion
	}
	
	
}	

